<!--{if $share_list}-->
<div class="piece1 mb15">
	<div id="discount_bar"></div>
	<div id="discount_share_list">
		<ul>
			<!--{loop $share_list $share}-->
				<li >
					<div class="share_container">
						<div class="time_left" endtime="{$share['discount_end_time']}"></div>
						<a href="{u book/shopping sid=$share['share_id']}" target="_blank">
							<img class="img lazyload" src="./tpl/images/lazyload.gif" original="{getimgbyid $share['img_id'] 160 160}" scaleWidth="160" scaleHeight="160" />
						</a>
						<div class="discount_share_name" >
							{$share['name']}
						</div>
						<!--{if ""!=$share['mall_name']}-->
						<div class="discount_mall">
							<span style="color: #FB5FAC">{$share['mall_name']}商城<span><span style="margin-left: 1em">有售</span>
						</div>
						<!--{/if}-->
						<div class="discount_index_price"><span class="discount_index_price1">{$share['pub_out_money_1']}</span><span class="discount_index_price2">{$share['pub_out_money_2']}</span><span class="discount">[{$share['dzt_discount']}折]</span></div>
					</div>
				</li>
			<!--{/loop}-->
		</ul>
	</div>
</div>
<script>
function discountEndtime(){
$(".time_left").each(function(){
var endtime = new Date($(this).attr("endtime")).getTime();//取结束日期(毫秒值)
var nowtime = new Date().getTime();        //今天的日期(毫秒值)
var youtime = endtime-nowtime;//还有多久(毫秒值)
var seconds = youtime/1000;
var minutes = Math.floor(seconds/60);
var hours = Math.floor(minutes/60);
var days = Math.floor(hours/24);
var CDay= days ;
var CHour= hours % 24;
var CMinute= minutes % 60;
var CSecond= Math.floor(seconds%60);//"%"是取余运算，可以理解为60进一后取余数，然后只要余数。
if(endtime<=nowtime){
$(this).html("已过期")//如果结束日期小于当前日期就提示过期啦
}else{
$(this).html("<b>剩余：</b><span>"+days+"</span>天<span>"+CHour+"</span>时<span>"+CMinute+"</span>分<span>"+CSecond+"</span>秒");          //输出有天数的数据
}
});
setTimeout("discountEndtime()",1000);
};
$(function(){
	discountEndtime();
});
</script>
<!--{/if}-->